package com.yjy.mybase;

import android.app.Application;
import android.content.Context;

import com.alibaba.android.arouter.launcher.ARouter;
import com.qpg.superhttp.SuperHttp;
import com.yjy.mybase.http.SuperHttpHelper;

/**
 * author : YangJinyang
 * create : 2019-10-28 16:09
 * description :
 */
public class BaseApplication extends Application {

    private static Context context;
    private static final String TAG = "BaseApplication";


    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        init();
    }

    public static Context getContext() {
        return context;
    }

    private void init() {

        if (BuildConfig.DEBUG) {
            ARouter.openDebug();
            ARouter.openLog();
        }

        /**
         * 初始化 ARouter
         */
        ARouter.init(this);

        /**
         * SuperHttp
         */
        SuperHttp.init(this);
        SuperHttp.config()
                //配置请求主机地址
                .setBaseUrl(SuperHttpHelper.BaseUrl);



    }


}
